<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" layout:decorate="main"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head>
    <title>门诊患者库</title>
    <link th:href="@{/localcss/crmlist.css}" href="../static/localcss/crmlist.css" rel="stylesheet">

    <style>

        #col-i {
            width: 200px;
        }

        #light ul li {
            list-style: none;
            height: 50px;
        }

        #light ul li {
            list-style: none;
            height: 50px;
        }

        #light ul li span {
            float: right;
        }

        .form-group input {
            width: 200px;
        }

        .form-group select {
            width: 200px;
        }

        .form-radio input {
            margin-left: 20px;
        }

        .form-group button {
            margin-top: 30px;
            margin-left: 80px;
        }

    </style>
</head>
<body>
<div layout:fragment="content">
    <div class="col-md-12 col-sm-12 col-xs-12">
        <div class="x_panel">
            <div class="x_title">
                <h2>
                    用户挂号 <i class="fa fa-user"></i>
                    <small>
                        - 您可以通过搜索或者其他的筛选项对用户的信息进行编辑、删除等管理操作。^_^
                    </small>
                </h2>
                <div class="clearfix"></div>
            </div>
            <div class="x_content">
                <form>
                    <input type="hidden" name="current" th:value="1">
                    <ul>
                        <li>
                            <div class="form-group" id="userxx">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12">用户信息</label>
                                <div class="col-md-6 col-sm-6 col-xs-12">
                                    <input id="col-i" name="reportName" type="text" placeholder="请输入要查询的信息"
                                           class="form-control col-md-6 col-xs-12" value="">
                                </div>
                            </div>
                        </li>
                        <li>
                            <button type="button" class="btn btn-primary" id="doSearch"> 查 &nbsp;&nbsp;&nbsp;&nbsp;询
                            </button>
                        </li>
                    </ul>
                </form>
            </div>
            <div class="x_content">
                <p class="text-muted font-13 m-b-30"></p>
                <div id="datatable-responsive_wrapper"
                     class="dataTables_wrapper form-inline dt-bootstrap no-footer">
                    <div class="row">

                        <div class="col-sm-12">
                            <table id=" datatable-responsive"
                                   class="table table-striped table-bordered dt-responsive nowrap dataTable no-footer
                            dtr-inline collapsed"
                                   cellspacing="0" width="100%" role="grid"
                                   aria-describedby="datatable-responsive_info" style="width: 100%;">
                                <thead>
                                <tr role="row">
                                    <th class="sorting_asc" tabindex="0"
                                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                        aria-label="First name: activate to sort column descending"
                                        aria-sort="ascending">就诊号
                                    </th>
                                    <th class="sorting" tabindex="0"
                                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                        aria-label="Last name: activate to sort column ascending">
                                        姓名
                                    </th>
                                    <th class="sorting" tabindex="0"
                                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                        aria-label="Last name: activate to sort column ascending">
                                        电话
                                    </th>
                                    <th class="sorting" tabindex="0"
                                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                        aria-label="Last name: activate to sort column ascending">
                                        身份证号
                                    </th>
                                    <th class="sorting" tabindex="0"
                                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                        aria-label="Last name: activate to sort column ascending">
                                        性别
                                    </th>
                                    <th class="sorting" tabindex="0"
                                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                        aria-label="Last name: activate to sort column ascending">
                                        年龄
                                    </th>
                                    <th class="sorting" tabindex="0"
                                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                        aria-label="Last name: activate to sort column ascending">
                                        科室
                                    </th>
                                    <th class="sorting" tabindex="0"
                                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                        aria-label="Last name: activate to sort column ascending">
                                        医生
                                    </th>
                                    <th class="sorting" tabindex="0"
                                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                        aria-label="Last name: activate to sort column ascending">
                                        挂号类别
                                    </th>
                                    <th class="sorting" tabindex="0"
                                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                        aria-label="Last name: activate to sort column ascending">
                                        病况
                                    </th>
                                    <th class="sorting" tabindex="0"
                                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                        aria-label="Last name: activate to sort column ascending">
                                        挂号时间
                                    </th>
                                    <th class="sorting" tabindex="0"
                                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                        aria-label="Last name: activate to sort column ascending">
                                        挂号费
                                    </th>
                                    <th class="sorting" tabindex="0"
                                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                        aria-label="Last name: activate to sort column ascending">
                                        操作
                                    </th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr role="row" class="odd" th:each="report:${report.records}">
                                    <td tabindex="0" class="sorting_1" th:text="${report.reportId}">usrId</td>
                                    <td th:text="${report.reportName}">reportName</td>
                                    <td th:text="${report.phone}">phone</td>
                                    <td th:text="${report.carid}"></td>
                                    <td th:text="${report.sex}"></td>
                                    <td th:text="${report.age}"></td>
                                    <td th:text="${report.department}"></td>
                                    <td th:text="${report.doctorName}"></td>
                                    <td th:text="${report.type}"></td>
                                    <td th:text="${report.zhuan}"></td>
                                    <td th:text="${report.time}"></td>
                                    <td th:text="${report.price}"></td>
                                    <td>
                                        <div class="btn-group">
                                            <button class="btn btn-danger">点击操作</button>
                                            <button type="button" class="btn btn-danger dropdown-toggle"
                                                    data-toggle="dropdown" aria-expanded="false">
                                                <span class="caret"></span>
                                                <span class="sr-only">Toggle Dropdown</span>
                                            </button>
                                            <ul class="dropdown-menu" role="menu">
                                                <li><a class="editInfo" href="/user/edit?usrId=1"

                                                       data-toggle="tooltip" data-placement="top" title=""
                                                       data-original-title="编辑">编辑</a></li>
                                                <li><a class="delInfo" id="del" href="#"

                                                       data-toggle="tooltip" data-placement="top" title=""
                                                       data-original-title="删除">删除</a></li>
                                            </ul>
                                        </div>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                            <div class="row">
                                <div class="col-sm-5">
                                    <div class="dataTables_info" id="datatable-responsive_info"
                                         role="status" aria-live="polite">共<span
                                            th:text="${report.records.size() }">1</span>条记录
                                        <span th:text="${report.getCurrent() }">1</span>/<span
                                                th:text="${report.getPages() }">1</span>页
                                    </div>
                                </div>
                                <div class="col-sm-7">
                                    <div class="dataTables_paginate paging_simple_numbers"
                                         id="datatable-responsive_paginate">
                                        <ul class="pagination">
                                            <li class="paginate_button previous" th:if="${report.getCurrent() gt 0}"><a
                                                    href="javascript:page_navg(document.forms[1],1);"
                                                    aria-controls="datatable-responsive" data-dt-idx="0"
                                                    tabindex="0">首页</a>
                                            </li>
                                            <li class="paginate_button " th:if="${report.getCurrent() gt 0}"><a
                                                    href="#"
                                                    th:onclick="'javascript:page_navg(document.forms[1],'+${report.getCurrent()}+');'"
                                                    aria-controls="datatable-responsive" data-dt-idx="1"
                                                    tabindex="0">上一页</a>
                                            </li>
                                            <li class="paginate_button "
                                                th:if="${(report.getCurrent()) lt report.getPages()}"><a
                                                    href="#"
                                                    th:onclick="'javascript:page_navg(document.forms[1],'+${report.getCurrent()+1 }+');'"
                                                    aria-controls="datatable-responsive" data-dt-idx="1"
                                                    tabindex="0">下一页</a>
                                            </li>
                                            <li class="paginate_button next"
                                                th:if="${(report.getCurrent()) lt report.pages}"><a
                                                    href="#"
                                                    th:onclick="'javascript:page_navg(document.forms[1],'+${report.getPages() }+');'"
                                                    aria-controls="datatable-responsive" data-dt-idx="7"
                                                    tabindex="0">最后一页</a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script layout:fragment="js">
    //模糊查询
    $("#doSearch").click(function () {
        var name = $("#col-i").val();
        var cc = $('input[name="dang"]:checked').val();
        cc == undefined ? cc = 1 : cc = cc
        location.href = "/register/registerPage?params=" + name + "&cc=" + cc;
    });


    //点击新增患者事件
    function addtc() {
        //查询所有科室
        $.getJSON("/register/seldep", function (obj) {
            $(obj).each(function () {
                //拼接科室下拉框
                var doption = "<option value=" + this.departmentId + ">" + this.department + "</option>";
                $("#department").append(doption);
            });
        });
        //查询所有挂号类型
        $.getJSON("/register/selreg", function (obj) {
            $(obj).each(function () {
                //拼接挂号类型下拉框
                var doption = "<option value=" + this.registeredId + ">" + this.type + "</option>";
                $("#reporttype").append(doption);
            });
        });
        //显示添加弹框
        document.getElementById('light').style.display = 'block';
    }

    //选择科室、挂号类型时事件方法
    function fudoctor() {
        $("#doctor").empty();
        var departmentId = $("#department").val();
        var registeredId = $("#reporttype").val();
        if ($("#doctor").val() == null) {
            $("#doctor").append("<option value='0'>--请选择--</option>")
        }
        //根据科室ID、挂号类型ID查询医生
        $.getJSON("/register/seldoctor", {departmentId: departmentId, registeredid: registeredId}, function (obj) {
            $(obj).each(function () {
                //拼接医生下拉框
                var doption = "<option value=" + this.doctorId + ">" + this.doctorName + "</option>";
                $("#doctor").append(doption);
            });
        });
        //根据类型ID查询价格
        $.getJSON("/register/seltymo", {registeredId: registeredId}, function (obj) {
            $("#price").val(obj);
        });
    }

</script>
</html>